Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: fix optree compatibility for multi-tree-map with None values #195

Merged
merged 11 commits into from
Nov 9, 2023

Conversation

XuehaiPan
Copy link
Member

Description

Describe your changes in detail.

Fix None handling for optimizers.

Motivation and Context

Why is this change required? What problem does it solve?
If it fixes an open issue, please link to the issue here.
You can use the syntax close #15213 if this solves the issue #15213

  • I have raised an issue to propose this change (required for new features and bug fixes)

Types of changes

What types of changes does your code introduce? Put an x in all the boxes that apply:

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds core functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation (update in the documentation)
  • Example (update in the folder of example)

Checklist

Go over all the following points, and put an x in all the boxes that apply.
If you are unsure about any of these, don't hesitate to ask. We are here to help!

  • I have read the CONTRIBUTION guide. (required)
  • My change requires a change to the documentation.
  • I have updated the tests accordingly. (required for a bug fix or a new feature)
  • I have updated the documentation accordingly.
  • I have reformatted the code using make format. (required)
  • I have checked the code using make lint. (required)
  • I have ensured make test pass. (required)

@XuehaiPan XuehaiPan added bug Something isn't working dependencies Pull requests that update a dependency file labels Nov 8, 2023
@XuehaiPan XuehaiPan self-assigned this Nov 8, 2023
XuehaiPan and others added 6 commits November 8, 2023 20:15
updates:
- [github.com/pre-commit/pre-commit-hooks: v4.4.0 → v4.5.0](pre-commit/pre-commit-hooks@v4.4.0...v4.5.0)
- [github.com/pre-commit/mirrors-clang-format: v16.0.6 → v17.0.4](pre-commit/mirrors-clang-format@v16.0.6...v17.0.4)
- [github.com/astral-sh/ruff-pre-commit: v0.0.287 → v0.1.4](astral-sh/ruff-pre-commit@v0.0.287...v0.1.4)
- [github.com/psf/black: 23.7.0 → 23.10.1](psf/black@23.7.0...23.10.1)
- [github.com/asottile/pyupgrade: v3.10.1 → v3.15.0](asottile/pyupgrade@v3.10.1...v3.15.0)
- [github.com/codespell-project/codespell: v2.2.5 → v2.2.6](codespell-project/codespell@v2.2.5...v2.2.6)
Copy link

codecov bot commented Nov 8, 2023

Codecov Report

Attention: 2 lines in your changes are missing coverage. Please review.

Comparison is base (86b167c) 93.65% compared to head (7f63f10) 93.69%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #195      +/-   ##
==========================================
+ Coverage   93.65%   93.69%   +0.04%     
==========================================
  Files          83       83              
  Lines        2945     2963      +18     
==========================================
+ Hits         2758     2776      +18     
  Misses        187      187              
Flag Coverage Δ
unittests 93.69% <97.78%> (+0.04%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Coverage Δ
torchopt/alias/sgd.py 100.00% <ø> (ø)
torchopt/alias/utils.py 98.84% <100.00%> (+0.06%) ⬆️
torchopt/linalg/cg.py 98.15% <ø> (ø)
torchopt/linalg/ns.py 41.38% <ø> (ø)
torchopt/transform/add_decayed_weights.py 95.71% <100.00%> (+0.13%) ⬆️
torchopt/transform/scale_by_adadelta.py 100.00% <100.00%> (ø)
torchopt/transform/scale_by_adam.py 100.00% <100.00%> (ø)
torchopt/transform/scale_by_adamax.py 100.00% <100.00%> (ø)
torchopt/transform/scale_by_rms.py 100.00% <100.00%> (ø)
torchopt/transform/scale_by_rss.py 100.00% <100.00%> (ø)
... and 6 more

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@XuehaiPan XuehaiPan force-pushed the fix-optree branch 3 times, most recently from c23441e to 6bc03d5 Compare November 8, 2023 14:50
@XuehaiPan XuehaiPan changed the title fix: fix optree compatibility fix: fix optree compatibility for multi-treemap with None values Nov 8, 2023
@XuehaiPan XuehaiPan changed the title fix: fix optree compatibility for multi-treemap with None values fix: fix optree compatibility for multi-tree-map with None values Nov 8, 2023
Copy link
Member

@Benjamin-eecs Benjamin-eecs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please fix lint error.

Copy link
Member

@Benjamin-eecs Benjamin-eecs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@XuehaiPan XuehaiPan merged commit 93cc7ec into metaopt:main Nov 9, 2023
13 checks passed
@XuehaiPan XuehaiPan deleted the fix-optree branch November 9, 2023 11:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working dependencies Pull requests that update a dependency file
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants